diff --git a/examples/Makefile b/examples/Makefile
index 163b404..b690fa0 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -33,7 +33,7 @@
 BIN    += sched.bin
 endif
 
-ifeq ($(CPU),mips)
+ifeq ($(ARCH),mips)
 SREC =
 BIN =
 endif
@@ -44,6 +44,12 @@
 BIN    += timer.bin
 endif
 
+# The following example is 8260 specific...
+ifeq ($(CPU),mpc8260)
+SREC   += mem_to_mem_idma2intr.srec
+BIN    += mem_to_mem_idma2intr.bin
+endif
+
 # Utility for resetting i82559 EEPROM
 ifeq ($(BOARD),oxc)
 SREC   += eepro100_eeprom.srec
diff --git a/examples/mem_to_mem_idma2intr.c b/examples/mem_to_mem_idma2intr.c
new file mode 100644
index 0000000..93c6f77
--- /dev/null
+++ b/examples/mem_to_mem_idma2intr.c
@@ -0,0 +1,391 @@
+/* The dpalloc function used and implemented in this file was derieved
+ * from PPCBoot/U-Boot file "cpu/mpc8260/commproc.c".
+ */
+
+/* Author: Arun Dharankar <ADharankar@ATTBI.Com>
+ * This example is meant to only demonstrate how the IDMA could be used.
+ */
+
+/*
+ * This file is based on "arch/ppc/8260_io/commproc.c" - here is it's
+ * copyright notice:
+ *
+ * General Purpose functions for the global management of the
+ * 8260 Communication Processor Module.
+ * Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
+ * Copyright (c) 2000 MontaVista Software, Inc (source@mvista.com)
+ *  2.3.99 Updates
+ *
+ * In addition to the individual control of the communication
+ * channels, there are a few functions that globally affect the
+ * communication processor.
+ *
+ * Buffer descriptors must be allocated from the dual ported memory
+ * space.  The allocator for that is here.  When the communication
+ * process is reset, we reclaim the memory available.  There is
+ * currently no deallocator for this memory.
+ */
+
+
+
+#include <common.h>
+#include <syscall.h>
+
+#define STANDALONE
+
+#ifndef STANDALONE			/* Linked into/Part of  PPCBoot */
+#include <command.h>
+#include <watchdog.h>
+#else					/* Standalone app of PPCBoot */
+#include <syscall.h>
+#define printf	mon_printf
+#define tstc	mon_tstc
+#define getc	mon_getc
+#define putc	mon_putc
+#define udelay	mon_udelay
+#define malloc	mon_malloc
+#define WATCHDOG_RESET() {						\
+			*(ushort *)(CFG_IMMR + 0x1000E) = 0x556c;	\
+			*(ushort *)(CFG_IMMR + 0x1000E) = 0xaa39;	\
+		}
+#endif	/* STANDALONE */
+
+static int debug = 1;
+
+#define DEBUG(fmt, args...)	 {					\
+	if(debug != 0) {						\
+		printf("[%s %d %s]: ",__FILE__,__LINE__,__FUNCTION__);	\
+		printf(fmt, ##args);					\
+	}								\
+}
+
+#define CPM_CR_IDMA1_SBLOCK  (0x14)
+#define CPM_CR_IDMA2_SBLOCK  (0x15)
+#define CPM_CR_IDMA3_SBLOCK  (0x16)
+#define CPM_CR_IDMA4_SBLOCK  (0x17)
+#define CPM_CR_IDMA1_PAGE    (0x07)
+#define CPM_CR_IDMA2_PAGE    (0x08)
+#define CPM_CR_IDMA3_PAGE    (0x09)
+#define CPM_CR_IDMA4_PAGE    (0x0a)
+#define PROFF_IDMA1_BASE     ((uint)0x87fe)
+#define PROFF_IDMA2_BASE     ((uint)0x88fe)
+#define PROFF_IDMA3_BASE     ((uint)0x89fe)
+#define PROFF_IDMA4_BASE     ((uint)0x8afe)
+
+#define CPM_CR_INIT_TRX     ((ushort)0x0000)
+#define CPM_CR_FLG  ((ushort)0x0001)
+
+#define mk_cr_cmd(PG, SBC, MCN, OP) \
+    ((PG << 26) | (SBC << 21) | (MCN << 6) | OP)
+
+
+#pragma pack(1)
+typedef struct ibdbits {
+	unsigned b_valid:1;
+	unsigned b_resv1:1;
+	unsigned b_wrap:1;
+	unsigned b_interrupt:1;
+	unsigned b_last:1;
+	unsigned b_resv2:1;
+	unsigned b_cm:1;
+	unsigned b_resv3:2;
+	unsigned b_sdn:1;
+	unsigned b_ddn:1;
+	unsigned b_dgbl:1;
+	unsigned b_dbo:2;
+	unsigned b_resv4:1;
+	unsigned b_ddtb:1;
+	unsigned b_resv5:2;
+	unsigned b_sgbl:1;
+	unsigned b_sbo:2;
+	unsigned b_resv6:1;
+	unsigned b_sdtb:1;
+	unsigned b_resv7:9;
+} ibdbits_t;
+
+#pragma pack(1)
+typedef union ibdbitsu {
+	ibdbits_t b;
+	uint i;
+} ibdbitsu_t;
+
+#pragma pack(1)
+typedef struct idma_buf_desc {
+	ibdbitsu_t ibd_bits;		/* Status and Control */
+	uint ibd_datlen;		/* Data length in buffer */
+	uint ibd_sbuf;			/* Source buffer addr in host mem */
+	uint ibd_dbuf;			/* Destination buffer addr in host mem */
+} ibd_t;
+
+
+#pragma pack(1)
+typedef struct dcmbits {
+	unsigned b_fb:1;
+	unsigned b_lp:1;
+	unsigned b_resv1:3;
+	unsigned b_tc2:1;
+	unsigned b_resv2:1;
+	unsigned b_wrap:3;
+	unsigned b_sinc:1;
+	unsigned b_dinc:1;
+	unsigned b_erm:1;
+	unsigned b_dt:1;
+	unsigned b_sd:2;
+} dcmbits_t;
+
+#pragma pack(1)
+typedef union dcmbitsu {
+	dcmbits_t b;
+	ushort i;
+} dcmbitsu_t;
+
+#pragma pack(1)
+typedef struct pram_idma {
+	ushort pi_ibase;
+	dcmbitsu_t pi_dcmbits;
+	ushort pi_ibdptr;
+	ushort pi_dprbuf;
+	ushort pi_bufinv;		/* internal to CPM */
+	ushort pi_ssmax;
+	ushort pi_dprinptr;		/* internal to CPM */
+	ushort pi_sts;
+	ushort pi_dproutptr;		/* internal to CPM */
+	ushort pi_seob;
+	ushort pi_deob;
+	ushort pi_dts;
+	ushort pi_retadd;
+	ushort pi_resv1;		/* internal to CPM */
+	uint pi_bdcnt;
+	uint pi_sptr;
+	uint pi_dptr;
+	uint pi_istate;
+} pram_idma_t;
+
+
+volatile immap_t *immap = (immap_t *) CFG_IMMR;
+volatile ibd_t *bdf;
+volatile pram_idma_t *piptr;
+
+volatile int dmadone;
+volatile int *dmadonep = &dmadone;
+void dmadone_handler (void *);
+
+int idma_init (void);
+void idma_start (int, int, int, uint, uint, int);
+uint dpalloc (uint, uint);
+
+
+uint dpinit_done = 0;
+
+
+#ifdef STANDALONE
+int ctrlc (void)
+{
+	if (mon_tstc()) {
+		switch (mon_getc ()) {
+		case 0x03:		/* ^C - Control C */
+			return 1;
+		default:
+			break;
+		}
+	}
+	return 0;
+}
+void * memset(void * s,int c,size_t count)
+{
+	char *xs = (char *) s;
+	while (count--)
+		*xs++ = c;
+	return s;
+}
+int memcmp(const void * cs,const void * ct,size_t count)
+{
+	const unsigned char *su1, *su2;
+	int res = 0;
+	for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
+		if ((res = *su1 - *su2) != 0)
+			break;
+	return res;
+}
+#endif	/* STANDALONE */
+
+#ifdef STANDALONE
+int mem_to_mem_idma2intr (bd_t * bd, int argc, char *argv[])
+#else
+int do_idma (bd_t * bd, int argc, char *argv[])
+#endif	/* STANDALONE */
+{
+	int i;
+
+	dpinit_done = 0;
+
+	idma_init ();
+
+	DEBUG ("Installing dma handler\n");
+	mon_install_hdlr (7, dmadone_handler, (void *) bdf);
+
+	memset ((void *) 0x100000, 'a', 512);
+	memset ((void *) 0x200000, 'b', 512);
+
+	for (i = 0; i < 32; i++) {
+		printf ("Startin IDMA, iteration=%d\n", i);
+		idma_start (1, 1, 512, 0x100000, 0x200000, 3);
+	}
+
+	DEBUG ("Uninstalling dma handler\n");
+	mon_free_hdlr (7);
+
+	return 0;
+}
+
+void
+idma_start (int sinc, int dinc, int sz, uint sbuf, uint dbuf, int ttype)
+{
+	/* ttype is for M-M, M-P, P-M or P-P: not used for now */
+
+	piptr->pi_istate = 0;	/* manual says: clear it before every START_IDMA */
+	piptr->pi_dcmbits.b.b_resv1 = 0;
+
+	if (sinc == 1)
+		piptr->pi_dcmbits.b.b_sinc = 1;
+	else
+		piptr->pi_dcmbits.b.b_sinc = 0;
+
+	if (dinc == 1)
+		piptr->pi_dcmbits.b.b_dinc = 1;
+	else
+		piptr->pi_dcmbits.b.b_dinc = 0;
+
+	piptr->pi_dcmbits.b.b_erm = 0;
+	piptr->pi_dcmbits.b.b_sd = 0x00;	/* M-M */
+
+	bdf->ibd_sbuf = sbuf;
+	bdf->ibd_dbuf = dbuf;
+	bdf->ibd_bits.b.b_cm = 0;
+	bdf->ibd_bits.b.b_interrupt = 1;
+	bdf->ibd_bits.b.b_wrap = 1;
+	bdf->ibd_bits.b.b_last = 1;
+	bdf->ibd_bits.b.b_sdn = 0;
+	bdf->ibd_bits.b.b_ddn = 0;
+	bdf->ibd_bits.b.b_dgbl = 0;
+	bdf->ibd_bits.b.b_ddtb = 0;
+	bdf->ibd_bits.b.b_sgbl = 0;
+	bdf->ibd_bits.b.b_sdtb = 0;
+	bdf->ibd_bits.b.b_dbo = 1;
+	bdf->ibd_bits.b.b_sbo = 1;
+	bdf->ibd_bits.b.b_valid = 1;
+	bdf->ibd_datlen = 512;
+
+	*dmadonep = 0;
+
+	immap->im_sdma.sdma_idmr2 = (uchar) 0xf;
+
+	immap->im_cpm.cp_cpcr = mk_cr_cmd (CPM_CR_IDMA2_PAGE,
+					   CPM_CR_IDMA2_SBLOCK, 0x0,
+					   0x9) | 0x00010000;
+
+	while (*dmadonep != 1) {
+		if (ctrlc ()) {
+			DEBUG ("\nInterrupted waiting for DMA interrupt.\n");
+			goto done;
+		}
+		printf ("Waiting for DMA interrupt (dmadone=%d b_valid = %d)...\n",
+			dmadone, bdf->ibd_bits.b.b_valid);
+		udelay (1000000);
+	}
+	printf ("DMA complete notification received!\n");
+
+  done:
+	DEBUG ("memcmp(0x%08x, 0x%08x, 512) = %d\n",
+		sbuf, dbuf, memcmp ((void *) sbuf, (void *) dbuf, 512));
+
+	return;
+}
+
+#define MAX_INT_BUFSZ	64
+#define DCM_WRAP	 0	/* MUST be consistant with MAX_INT_BUFSZ */
+
+int idma_init (void)
+{
+	uint memaddr;
+
+	immap->im_cpm.cp_rccr &= ~0x00F3FFFF;
+	immap->im_cpm.cp_rccr |= 0x00A00A00;
+
+	memaddr = dpalloc (sizeof (pram_idma_t), 64);
+
+	*(volatile ushort *) &immap->im_dprambase[PROFF_IDMA2_BASE] = memaddr;
+	piptr = (volatile pram_idma_t *) ((uint) (immap) + memaddr);
+
+	piptr->pi_resv1 = 0;		/* manual says: clear it */
+	piptr->pi_dcmbits.b.b_fb = 0;
+	piptr->pi_dcmbits.b.b_lp = 1;
+	piptr->pi_dcmbits.b.b_erm = 0;
+	piptr->pi_dcmbits.b.b_dt = 0;
+
+	memaddr = (uint) dpalloc (sizeof (ibd_t), 64);
+	piptr->pi_ibase = piptr->pi_ibdptr = (volatile short) memaddr;
+	bdf = (volatile ibd_t *) ((uint) (immap) + memaddr);
+	bdf->ibd_bits.b.b_valid = 0;
+
+	memaddr = (uint) dpalloc (64, 64);
+	piptr->pi_dprbuf = (volatile ushort) memaddr;
+	piptr->pi_dcmbits.b.b_wrap = 4;
+	piptr->pi_ssmax = 32;
+
+	piptr->pi_sts = piptr->pi_ssmax;
+	piptr->pi_dts = piptr->pi_ssmax;
+
+	return 1;
+}
+
+void dmadone_handler (void *arg)
+{
+	immap->im_sdma.sdma_idmr2 = (uchar) 0x0;
+
+	*dmadonep = 1;
+
+	return;
+}
+
+
+static uint dpbase = 0;
+
+uint dpalloc (uint size, uint align)
+{
+	DECLARE_GLOBAL_DATA_PTR;
+
+	volatile immap_t *immr = (immap_t *) CFG_IMMR;
+	uint retloc;
+	uint align_mask, off;
+	uint savebase;
+
+	/* Pointer to initial global data area */
+
+	if (dpinit_done == 0) {
+		dpbase = gd->dp_alloc_base;
+		dpinit_done = 1;
+	}
+
+	align_mask = align - 1;
+	savebase = dpbase;
+
+	if ((off = (dpbase & align_mask)) != 0)
+		dpbase += (align - off);
+
+	if ((off = size & align_mask) != 0)
+		size += align - off;
+
+	if ((dpbase + size) >= gd->dp_alloc_top) {
+		dpbase = savebase;
+		printf ("dpalloc: ran out of dual port ram!");
+		return 0;
+	}
+
+	retloc = dpbase;
+	dpbase += size;
+
+	memset ((void *) &immr->im_dprambase[retloc], 0, size);
+
+	return (retloc);
+}
diff --git a/examples/ppc_longjmp.S b/examples/ppc_longjmp.S
index ad8285a..5ca6f6f 100644
--- a/examples/ppc_longjmp.S
+++ b/examples/ppc_longjmp.S
@@ -30,9 +30,9 @@
 #define FP(x...) x
 #define FP(x...) x
 
-.globl      longjmp;
+.globl      ppc_longjmp;
 
-longjmp:
+ppc_longjmp:
 	lwz r1,(JB_GPR1*4)(r3)
 	lwz r2,(JB_GPR2*4)(r3)
 	lwz r0,(JB_LR*4)(r3)
diff --git a/examples/ppc_setjmp.S b/examples/ppc_setjmp.S
index b718113..421abfd 100644
--- a/examples/ppc_setjmp.S
+++ b/examples/ppc_setjmp.S
@@ -34,8 +34,8 @@
 	mr  r1, r3
 	blr
 
-.globl      _setjmp;
-_setjmp:
+.globl      ppc_setjmp;
+ppc_setjmp:
 	stw  r1,(JB_GPR1*4)(3)
 	mflr r0
 	stw  r2,(JB_GPR2*4)(3)
diff --git a/examples/sched.c b/examples/sched.c
index 4f6f98e..ceb5c1f 100644
--- a/examples/sched.c
+++ b/examples/sched.c
@@ -3,12 +3,12 @@
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of
  * the License, or (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
@@ -17,7 +17,6 @@
 
 #include <common.h>
 #include <syscall.h>
-#include <setjmp.h>
 
 /*
  * Author: Arun Dharankar <ADharankar@ATTBI.Com>
@@ -54,6 +53,13 @@
 #define RC_FAILURE	(-1)
 #define	RC_SUCCESS	(0)
 
+typedef	vu_char *jmp_ctx;
+unsigned long setctxsp (vu_char *sp);
+int ppc_setjmp(jmp_ctx env);
+void ppc_longjmp(jmp_ctx env, int val);
+#define setjmp	ppc_setjmp
+#define longjmp	ppc_longjmp
+
 struct lthread {
 	int state;
 	int retval;
@@ -68,13 +74,13 @@
 
 static uchar dbg = 0;
 
-#define DEBUG(fmt, args...)	 {												\
-		if(dbg != 0) {														\
-			mon_printf("[%s %d %s]: ", __FILE__, __LINE__, __FUNCTION__);	\
-			mon_printf(fmt, ##args);										\
-			mon_printf("\n");												\
-		}																	\
-	}
+#define PDEBUG(fmt, args...)	 {					\
+	if(dbg != 0) {							\
+		mon_printf("[%s %d %s]: ",__FILE__,__LINE__,__FUNCTION__);\
+		mon_printf(fmt, ##args);				\
+		mon_printf("\n");					\
+	}								\
+}
 
 static int testthread (void *);
 static void sched_init (void);
@@ -83,14 +89,15 @@
 static void thread_yield (void);
 static int thread_delete (int id);
 static int thread_join (int *ret);
-#if 0 /* not used yet */
+
+#if 0							/* not used yet */
 static int thread_stop (int id);
-#endif /* not used yet */
+#endif							/* not used yet */
 
 /* An example of schedular test */
 
 #define NUMTHREADS 7
-int sched (bd_t *bd, int ac, char *av[])
+int sched (bd_t * bd, int ac, char *av[])
 {
 	int i, j;
 	int tid[NUMTHREADS];
@@ -102,11 +109,10 @@
 		names[i] = i;
 		j = thread_create (testthread, (void *) &names[i]);
 		if (j == RC_FAILURE)
-			mon_printf ("schedtest: Failed to create thread %d\n",
-			i);
+			mon_printf ("schedtest: Failed to create thread %d\n", i);
 		if (j > 0) {
 			mon_printf ("schedtest: Created thread with id %d, name %d\n",
-				j, i);
+						j, i);
 			tid[i] = j;
 		}
 	}
@@ -125,8 +131,7 @@
 		if (mon_tstc () && mon_getc () == 0x3) {
 			mon_printf ("schedtest: Aborting threads...\n");
 			for (i = 0; i < NUMTHREADS; i++) {
-				mon_printf ("schedtest: Deleting thread %d\n",
-					tid[i]);
+				mon_printf ("schedtest: Deleting thread %d\n", tid[i]);
 				thread_delete (tid[i]);
 			}
 			return RC_SUCCESS;
@@ -135,11 +140,10 @@
 		i = thread_join (&j);
 		if (i == RC_FAILURE) {
 			mon_printf ("schedtest: No threads pending, "
-				"exiting schedular test\n");
+						"exiting schedular test\n");
 			return RC_SUCCESS;
 		}
-		mon_printf ("schedtest: thread is %d returned %d\n", i,
-					j);
+		mon_printf ("schedtest: thread is %d returned %d\n", i, j);
 		thread_yield ();
 	}
 
@@ -151,14 +155,14 @@
 	int i;
 
 	mon_printf ("testthread: Begin executing thread, myname %d, &i=0x%08x\n",
-		 *(int *) name, &i);
+			 *(int *) name, &i);
 
 	mon_printf ("Thread %02d, i=%d\n", *(int *) name);
 
 	for (i = 0; i < 0xffff * (*(int *) name + 1); i++) {
 		if (mon_tstc () && mon_getc () == 0x3) {
 			mon_printf ("testthread: myname %d terminating.\n",
-				*(int *) name);
+						*(int *) name);
 			return *(int *) name + 1;
 		}
 
@@ -167,7 +171,7 @@
 	}
 
 	mon_printf ("testthread: returning %d, i=0x%x\n",
-		*(int *) name + 1, i);
+				*(int *) name + 1, i);
 
 	return *(int *) name + 1;
 }
@@ -182,8 +186,8 @@
 
 	current_tid = MASTER_THREAD;
 	lthreads[current_tid].state = STATE_RUNNABLE;
-	DEBUG ("sched_init: master context = 0x%08x",
-		lthreads[current_tid].context);
+	PDEBUG ("sched_init: master context = 0x%08x",
+		   lthreads[current_tid].context);
 	return;
 }
 
@@ -191,19 +195,19 @@
 {
 	static int i;
 
-	DEBUG ("thread_yield: current tid=%d", current_tid);
+	PDEBUG ("thread_yield: current tid=%d", current_tid);
 
 #define SWITCH(new) 							\
 	if(lthreads[new].state == STATE_RUNNABLE) {			\
-		DEBUG("thread_yield: %d match, ctx=0x%08x",		\
+		PDEBUG("thread_yield: %d match, ctx=0x%08x",		\
 			new, lthreads[current_tid].context); 		\
 		if(setjmp(lthreads[current_tid].context) == 0) {	\
 			current_tid = new;				\
-			DEBUG("thread_yield: tid %d returns 0",		\
+			PDEBUG("thread_yield: tid %d returns 0",	\
 				new); 					\
 			longjmp(lthreads[new].context, 1);		\
 		} else {						\
-			DEBUG("thread_yield: tid %d returns 1",		\
+			PDEBUG("thread_yield: tid %d returns 1",	\
 				new); 					\
 			return;						\
 		}							\
@@ -219,7 +223,7 @@
 		}
 	}
 
-	DEBUG ("thread_yield: returning from thread_yield");
+	PDEBUG ("thread_yield: returning from thread_yield");
 	return;
 }
 
@@ -232,12 +236,12 @@
 			lthreads[i].state = STATE_STOPPED;
 			lthreads[i].func = func;
 			lthreads[i].arg = arg;
-			DEBUG ("thread_create: returns new tid %d", i);
+			PDEBUG ("thread_create: returns new tid %d", i);
 			return i;
 		}
 	}
 
-	DEBUG ("thread_create: returns failure");
+	PDEBUG ("thread_create: returns failure");
 	return RC_FAILURE;
 }
 
@@ -255,13 +259,13 @@
 
 static void thread_launcher (void)
 {
-	DEBUG ("thread_launcher: invoking func=0x%08x",
+	PDEBUG ("thread_launcher: invoking func=0x%08x",
 		   lthreads[current_tid].func);
 
 	lthreads[current_tid].retval =
-			lthreads[current_tid].func(lthreads[current_tid].arg);
+			lthreads[current_tid].func (lthreads[current_tid].arg);
 
-	DEBUG ("thread_launcher: tid %d terminated", current_tid);
+	PDEBUG ("thread_launcher: tid %d terminated", current_tid);
 
 	lthreads[current_tid].state = STATE_TERMINATED;
 	thread_yield ();
@@ -272,7 +276,7 @@
 
 static int thread_start (int id)
 {
-	DEBUG ("thread_start: id=%d", id);
+	PDEBUG ("thread_start: id=%d", id);
 	if (id <= MASTER_THREAD || id > MAX_THREADS) {
 		return RC_FAILURE;
 	}
@@ -283,17 +287,17 @@
 	if (setjmp (lthreads[current_tid].context) == 0) {
 		lthreads[id].state = STATE_RUNNABLE;
 		current_tid = id;
-		DEBUG ("thread_start: to be stack=0%08x", lthreads[id].stack);
+		PDEBUG ("thread_start: to be stack=0%08x", lthreads[id].stack);
 		setctxsp (&lthreads[id].stack[STK_SIZE]);
 		thread_launcher ();
 	}
 
-	DEBUG ("thread_start: Thread id=%d started, parent returns", id);
+	PDEBUG ("thread_start: Thread id=%d started, parent returns", id);
 
 	return RC_SUCCESS;
 }
 
-#if 0	/* not used so far */
+#if 0							/* not used so far */
 static int thread_stop (int id)
 {
 	if (id <= MASTER_THREAD || id >= MAX_THREADS)
@@ -305,46 +309,46 @@
 	lthreads[id].state = STATE_STOPPED;
 	return RC_SUCCESS;
 }
-#endif /* not used so far */
+#endif							/* not used so far */
 
 static int thread_join (int *ret)
 {
 	int i, j = 0;
 
-	DEBUG ("thread_join: *ret = %d", *ret);
+	PDEBUG ("thread_join: *ret = %d", *ret);
 
 	if (!(*ret == -1 || *ret > MASTER_THREAD || *ret < MAX_THREADS)) {
-		DEBUG ("thread_join: invalid tid %d", *ret);
+		PDEBUG ("thread_join: invalid tid %d", *ret);
 		return RC_FAILURE;
 	}
 
 	if (*ret == -1) {
-		DEBUG ("Checking for tid = -1");
+		PDEBUG ("Checking for tid = -1");
 		while (1) {
-			/* DEBUG("thread_join: start while-loopn"); */
+			/* PDEBUG("thread_join: start while-loopn"); */
 			j = 0;
 			for (i = MASTER_THREAD + 1; i < MAX_THREADS; i++) {
 				if (lthreads[i].state == STATE_TERMINATED) {
 					*ret = lthreads[i].retval;
 					lthreads[i].state = STATE_EMPTY;
-					/* DEBUG("thread_join: returning retval %d of tid %d",
-						ret, i); */
+					/* PDEBUG("thread_join: returning retval %d of tid %d",
+					   ret, i); */
 					return RC_SUCCESS;
 				}
 
 				if (lthreads[i].state != STATE_EMPTY) {
-					DEBUG ("thread_join: %d used slots tid %d state=%d",
-						j, i, lthreads[i].state);
+					PDEBUG ("thread_join: %d used slots tid %d state=%d",
+						   j, i, lthreads[i].state);
 					j++;
 				}
 			}
 			if (j == 0) {
-				DEBUG ("thread_join: all slots empty!");
+				PDEBUG ("thread_join: all slots empty!");
 				return RC_FAILURE;
 			}
-			/*  DEBUG("thread_join: yielding"); */
+			/*  PDEBUG("thread_join: yielding"); */
 			thread_yield ();
-			/*  DEBUG("thread_join: back from yield"); */
+			/*  PDEBUG("thread_join: back from yield"); */
 		}
 	}
 
@@ -352,10 +356,10 @@
 		i = *ret;
 		*ret = lthreads[*ret].retval;
 		lthreads[*ret].state = STATE_EMPTY;
-		DEBUG ("thread_join: returing %d for tid %d", *ret, i);
+		PDEBUG ("thread_join: returing %d for tid %d", *ret, i);
 		return RC_SUCCESS;
 	}
 
-	DEBUG ("thread_join: thread %d is not terminated!", *ret);
+	PDEBUG ("thread_join: thread %d is not terminated!", *ret);
 	return RC_FAILURE;
 }
